<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
	<meta charset="utf-8" />
    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
	<title>{$tkd.title|parseTPL}</title>
	<meta name="keywords" content="{$tkd.keywords|parseTPL}" />
	<meta name="description" content="{$tkd.description|parsetpl}" />
	{include file="/system/head"}
	<link rel="stylesheet" href="{$kx.config.resurl}/template/kxwebno2/css/font-awesome.min.css">
</head>
<body>
{include file="/system/header"}
<section class="w-all booklist">
	<nav class="mt20">
		<ul class="clearfix">
            <li><a href="{$kx.config.siteurl}" title="{$kx.config.sitename}首页"><i class="pticon pticon-home pticon-lg"></i> {$kx.config.sitename}首页</a><i class="pticon pticon-angle-right icon"></i></li>
            <li><a href="{link=novel.category.list categoryid=$category.id key=$category.key}" title="{$category.name}小说">{$category.name}小说</a><i class="pticon pticon-angle-right icon"></i></li>
            <li><a href="{link=novel.novel.index novelid=$novel.id pinyin=$novel.pinyin}" title="{$novel.name}">{$novel.name}</a><i class="pticon pticon-angle-right icon"></i></li>
            <li><a href="{link=novel.comment.list novelid=$novel.id pinyin=$novel.pinyin}" title="{$novel.name}">{$novel.name}评论区</a></li>
		</ul>
	</nav>
	<div class="container clearfix mt20">
		<div class="w-left">
			<div class="card commentarea">
				<div class="header line">
					<h3>{$novel.name} 书友评论</h3>
				</div>
				<div class="body">
					<ul class="commentlist">
                        {block method="pagination" name="paginate" page=$page limit=$pagesize count=$data.comment maxpage=50 section=3}
                        {block method="comment.list" name=commentlist type='novel' typeid=$novel.id userid=$userinfo.id num=$paginate.limit page=$paginate.current}
                        {loop=commentlist}
						<li class="clearfix">
							<div class="avatar">
								<a href=""><img src="{$loop.user.avatar}" alt=""></a>
								<span>{$loop.user.name}</span>
							</div>
							<div class="item">
								<div class="title">
									<span class="time">{$loop.datetime|date="Y-m-d H:i:s"}</span>
									<span class="fr" data-id="{$loop.id}">
										<a class="up" title="赞同 {$loop.good_num}"><i class="fa fa-thumbs-up"></i> <span>{$loop.good_num}</span></a>
										<a class="down" title="反对 {$loop.bad_num}"><i class="fa fa-thumbs-down"></i> <span>{$loop.bad_num}</span></a>
										<a href="{link=novel.comment.post novelid=$novel.id pinyin=$novel.pinyin commentid=$loop.id}" title="回贴 {$loop.post_num}"><i class="fa fa-comment"></i> {$loop.post_num}</a>
									</span>
								</div>
								<div class="content needmore">
									<a href="{link=novel.comment.post novelid=$novel.id pinyin=$novel.pinyin commentid=$loop.id}">{$loop.content|nl2br}</a>
								</div>
								<div class="fr more">
									<a href="{link=novel.comment.post novelid=$novel.id pinyin=$novel.pinyin commentid=$loop.id}">[参与讨论]</a>
								</div>
							</div>
						</li>
						{/loop}
					</ul>
					<div class="footer pagination comment">
						<span>共{$paginate.total}页 {$paginate.count}条</span>
						{if $paginate.total>1}
						<a href="{link=list novelid=$novel.id pinyin=$novel.pinyin page=$paginate.first}" class="first number"><<</a>
						<a href="{link=list novelid=$novel.id pinyin=$novel.pinyin page=$paginate.prev}" class="prev number"><</a>
						{loop=$paginate.items}
						{if $loop.status}
						<a class="current" href="javascript:;">{$loop.num}</a>
						{else}
                        <a href="{link=post novelid=$novel.id pinyin=$novel.pinyin page=$loop.num}" class="number">{$loop.num}</a>
						{/if}
						{/loop}
						<a href="{link=list novelid=$novel.id pinyin=$novel.pinyin page=$paginate.next}" class="next number">&gt;</a>
						<a href="{link=list novelid=$novel.id pinyin=$novel.pinyin page=$paginate.last}" class="last number">&gt;&gt;</a>
						{/if}
					</div>
					<div class="addcomment clearfix">
						{if IS_LOGIN}
						<form action="{link=novel.comment.add}" method="post">
							<input type="hidden" name="type" value="novel">
							<input type="hidden" name="type_id" value="{$novel.id}">
							<textarea name="content" class="text"></textarea>
							<button class="btn btn-success fr">发布评论</button>
						</form>
						{else}
						<div class="tips">请您 <a href="{link=user.auth.register}">注册</a> 或 <a href="{link=user.auth.login}">登陆</a> 之后再发布评论</div>
						{/if}
					</div>
				</div>
			</div>
		</div>
		<div class="w-right">
			<div class="card pt-tab">
				<div class="header line">
					<h3>小说信息</h3>
				</div>
				<div class="body" style="height:245px;overflow: hidden">
					<ul class="rightlist">
						<li><b>书名：</b><a href="{link=novel.novel.index novelid=$novel.id pinyin=$novel.pinyin}">{$novel.name}</a></li>
						<li><b>作者：</b><a href="{link=author.space.index authorid=$author.id pinyin=$author.pinyin name=$author.name}">{$author.name}</a></li>
						<li><b>分类：</b><a href="{link=novel.category.list categoryid=$category.id key=$category.key}">{$category.name}</a></li>
						<li><b>来源：</b>{$source.name}({$source.host})</li>
						<li><b>点击：</b>{$data.allvisit}</li>
						<li><b>推荐：</b>{$data.vote}</li>
						<li><b>收藏：</b>{$data.mark}</li>
						<li><b>评分：</b>{$data.star}</li>
					</ul>
				</div>
			</div>
			<div class="card pt-tab mt20">
				<div class="header tab pt-tab-nav">
					<ul class="clearfix">
						<li class="active">本月热门</li>
						<li>本周热门</li>
					</ul>
				</div>
				<div class="body pt-tab-con">
                    <ul class="rightlist">
                        {block method="novel.list" name="list" order="monthvisit" num=15}
                        {section loop=$list}
                        <li><i {if $i.order<4}class="first"{/if}>{$i.order}</i><span><a href="{link=author.space.index authorid=$loop.author.id pinyin=$loop.author.pinyin name=$loop.author.name}" title="{$loop.author.name} 作品大全">{$loop.author.name}</a></span><a href="{link=novel.novel.index novelid=$loop.novel.id pinyin=$loop.novel.pinyin}" title="{$loop.novel.name}">{$loop.novel.name}</a>
                        </li>
                        {/section}
                    </ul>
                    <ul class="rightlist none">
                        {block method="novel.list" name="list" order="weekvisit" num=15}
                        {section loop=$list}
                        <li><i {if $i.order<4}class="first"{/if}>{$i.order}</i><span><a href="{link=author.space.index authorid=$loop.author.id pinyin=$loop.author.pinyin name=$loop.author.name}" title="{$loop.author.name} 作品大全">{$loop.author.name}</a></span><a href="{link=novel.novel.index novelid=$loop.novel.id pinyin=$loop.novel.pinyin}" title="{$loop.novel.name}">{$loop.novel.name}</a>
                        </li>
                        {/section}
                    </ul>
				</div>
			</div>
		</div>
	</div>
    <div class="seofooter">
        <p>
            <a href="#" title="{$novel.name}">《{$novel.name}》</a>是由<a href="{link=author.space.index authorid=$author.id pinyin=$author.pinyin name=$author.name">{$author.name}</a>倾情撰写的小说！<a href="#" title="{$novel.name}">《{$novel.name}》</a>为热心网友免费发布在<a href="{$kx.config.siteurl}">{$kx.config.sitename}</a>供大家免费阅读。
        </p>
        <p>欢迎进入<a href="#}" title="{$novel.name}">《{$novel.name}》</a>txt下载和<a href="#" title="{$novel.name}">《{$novel.name}》</a>全文阅读。谢谢您一直对<a href="{$kx.config.siteurl}">{$kx.config.sitename}</a>
            <a href="{link=novel.category.list categoryid=$category.id key=$category.key}">{$category.name}小说</a>的关注和支持！
        </p>
    </div>
</section>
{include file="/system/footer"}
<script type="text/javascript" src="{$kx.config.resurl}/template/kxwebno2/script/jquery.raty.js"></script>
<script type="text/javascript" src="{$kx.config.resurl}/template/kxwebno2/script/layer/layer.js"></script>
<script type="text/javascript">
	$(function () {
		$('.g-star').each(function () {
			$(this).raty({score: $(this).data('score')})
		});
		$('.open').on('click', function () {
			$(this).hide();
			$('.close').show();
			$('.intro').addClass('full');
		});
		$('.close').on('click', function () {
			$(this).hide();
			$('.open').show();
			$('.intro').removeClass('full');
		});
		$('.commentlist a').on('click', function () {
			var param = {comment_id: $(this).parent().data('id')}, $num = $(this).find('span'), url;
			if ($(this).hasClass('up')) {
				url = '{link=novel.comment.rating}';
				param.action='good';
			} else if ($(this).hasClass('down')) {
				url = '{link=novel.comment.rating}';
                param.action='bad';
			} else {
				return true;
			}
			$.post(url, param, function (res) {
				if (res.code === 0) {
					layer.alert(res.msg,{icon:6},function(i){
						$num.text(parseInt($num.text())+1);
						layer.close(i)
					});
				} else {
					layer.alert(res.msg, {icon: 5})
				}
			}, 'json')
		})
	})
</script>
</body>
</html>